Skip to content

chore(session): decompose SessionController into focused delegates#969

Merged
bmc08gt merged 4 commits into
code/cashfrom
chore/delegate-session-controller
Jun 24, 2026
Merged

chore(session): decompose SessionController into focused delegates#969
bmc08gt merged 4 commits into
code/cashfrom
chore/delegate-session-controller

Conversation

@bmc08gt

@bmc08gt bmc08gt commented Jun 23, 2026

Copy link
Copy Markdown
Collaborator

Extract RealSessionController domain logic into 5 delegates
(BillPresentationDelegate, CodeScanDelegate, CashLinkDelegate,
DepositDelegate, GiftCardSharingDelegate) with a shared
SessionStateHolder. The controller becomes a thin shell that wires
delegates and merges their event flows. Adds sub-interfaces
(BillOperations, CodeScanOperations, CashLinkOperations,
DepositOperations) for narrower API surfaces.

DepositDelegate owns deposit option presentation, USDC sweep
lifecycle, and the depositFirstUx feature flag — extracted from
CashLinkDelegate and the shell. CashLinkDelegate is now stateless
with no coroutine scope.

Cross-delegate events use Channel(UNLIMITED) for guaranteed
delivery (replacing SharedFlow). Includes 58 passing tests, KDoc
on all source files, and updated architecture docs.

@github-actions github-actions Bot added type: chore Maintenance, config, CI/CD area: session and removed type: chore Maintenance, config, CI/CD labels Jun 23, 2026
@bmc08gt bmc08gt force-pushed the chore/inject-dispatchers branch from ae1eb56 to 68cbee6 Compare June 23, 2026 17:00
@bmc08gt bmc08gt force-pushed the chore/delegate-session-controller branch from 98c446c to 65b6cda Compare June 23, 2026 17:01
@github-actions github-actions Bot added the type: chore Maintenance, config, CI/CD label Jun 23, 2026
Base automatically changed from chore/inject-dispatchers to code/cash June 23, 2026 17:17
@bmc08gt bmc08gt force-pushed the chore/delegate-session-controller branch 2 times, most recently from a4fab36 to 9644cc7 Compare June 23, 2026 19:37
@bmc08gt bmc08gt added the type: refactor Code restructuring, no behavior change label Jun 23, 2026
Extract RealSessionController domain logic into 5 delegates
(BillPresentationDelegate, CodeScanDelegate, CashLinkDelegate,
DepositDelegate, GiftCardSharingDelegate) with a shared
SessionStateHolder. The controller becomes a thin shell that wires
delegates and merges their event flows. Adds sub-interfaces
(BillOperations, CodeScanOperations, CashLinkOperations,
DepositOperations) for narrower API surfaces.

DepositDelegate owns deposit option presentation, USDC sweep
lifecycle, and the depositFirstUx feature flag — extracted from
CashLinkDelegate and the shell. CashLinkDelegate is now stateless
with no coroutine scope.

Cross-delegate events use Channel(UNLIMITED) for guaranteed
delivery (replacing SharedFlow). Includes 58 passing tests, KDoc
on all source files, and updated architecture docs.

Signed-off-by: Brandon McAnsh <[email protected]>
@bmc08gt bmc08gt force-pushed the chore/delegate-session-controller branch from 9644cc7 to 76b834c Compare June 23, 2026 20:26
@github-actions github-actions Bot added the area: tokens Token accounts, balances, token info label Jun 23, 2026
bmc08gt added 3 commits June 23, 2026 21:49
- build.gradle.kts: keep both testFixtures deps (coroutines + ui:resources)
- SessionControllerGiftCardErrorTest: keep PR's delegate params, drop
  purchaseMethodController (not in RealSessionController), fix
  TestDispatcherProvider field name
- UsdcDepositSweepTest: take code/cash's TestDispatchers approach
…atible

- GenerateCurveTables: replace `project.hasProperty()` in onlyIf with a
  serializable Property wired via providers.gradleProperty()
- GenerateEmojiList: extract inline doLast task into a proper abstract
  task class in buildSrc to avoid capturing script object references
- Add kotlinx-serialization-json to buildSrc deps for emoji JSON parsing
@bmc08gt bmc08gt merged commit 52fcd59 into code/cash Jun 24, 2026
3 checks passed
@bmc08gt bmc08gt deleted the chore/delegate-session-controller branch June 24, 2026 16:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: session area: tokens Token accounts, balances, token info type: chore Maintenance, config, CI/CD type: refactor Code restructuring, no behavior change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant